package com.zombieprogrammer.juego;

import java.util.Random;

public class Rnd {

	public Rnd() {
	}

	public float getRandomFloat(float min, float max, int dec) {
		Random rnd = new Random();
		int decimales = (int) Math.pow(10, dec) / 10;
		// System.out.println("decimales " + decimales);
		float f = (float) (rnd.nextFloat() * (max - min) + min);
		return (float) (Math.rint(f * decimales) / decimales);

	}

	public int getRandomInt(float f, float g) {
		g = g + 1;
		int i = (int) (f + Math.random() * (g - f));
		return i;
	}

}
